﻿using System.Windows;
using System.Windows.Input;
using DL.PhotoCollage.UI.StandAlone.Presentation;

namespace DL.PhotoCollage.UI.StandAlone.Views
{
    public partial class CollageView : Window
    {
        internal CollageView(CollagePresenter presenter)
        {
            this.DataContext = presenter;
            this.InitializeComponent();
        }

        internal CollagePresenter Presenter
        {
            get { return this.DataContext as CollagePresenter; }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Presenter.StartAnimation();
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
                case Key.Enter:
                case Key.Escape:
                    this.Presenter.Close();
                    break;
            }
        }
    }
}
